package com.cacshanghai.cac_oa_client.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.cacshanghai.cac_oa_client.R;

import java.util.List;

public class HorizontalListViewAdapter extends BaseAdapter {
    private Context mContext;
    private LayoutInflater mInflater;
    private int selectIndex = -1;
    private List<String> meetingList;

    public HorizontalListViewAdapter(Context context, List<String> meetingList) {
        this.mContext = context;
        this.meetingList = meetingList;
        mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);//LayoutInflater.from(mContext);
    }

    @Override
    public int getCount() {
//        return meetingList.size();
        return 6;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.item_meeting, null);
        }
        if (position % 2 == 0) {
            convertView.findViewById(R.id.ll_item_meeting).setBackgroundResource(R.color.white);
        } else {
            convertView.findViewById(R.id.ll_item_meeting).setBackgroundResource(R.color.gray);
        }
        return convertView;
    }

    public void setSelectIndex(int i) {
        selectIndex = i;
    }
}